import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { BrowserRouter, Route, Routes } from 'react-router-dom';

import Routers from '../routers';
import Header from '../containers/Header'
import { getClientStore } from '../store';

ReactDOM.render(
  <Provider store={getClientStore()}>
    <BrowserRouter>
      <Header />
      <div className="container" style={{ marginTop: 50 }}>
        <Routes>
          {Routers.map(route => (
            <Route {...route} />
          ))}
        </Routes>
      </div>
    </BrowserRouter>
  </Provider>
  , document.querySelector('#root'));